Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use a PackageFinder with ignore_compatibility when collecting hashes #4908

Merged
merged 1 commit into from
Jan 7, 2022

Conversation

jfly
Copy link
Contributor

@jfly jfly commented Jan 6, 2022

This fixes #4885

The checklist

  • Associated issue
  • A news fragment in the news/ directory to describe this fix with the extension .bugfix, .feature, .behavior, .doc. .vendor. or .trivial (this will appear in the release changelog). Use semantic line breaks and name the file after the issue number or the PR #.

@jfly jfly changed the title RFC: Use a PackageFinder with ignore_compatibility when collecting … RFC: Use a PackageFinder with ignore_compatibility when collecting hashes Jan 6, 2022
@jfly
Copy link
Contributor Author

jfly commented Jan 6, 2022

@frostming does this seem like the right direction? If so, I'll gladly polish this up!

@frostming
Copy link
Contributor

Setting ignore_compatibility is correct but we don't need to modify the vendors directory. I think it is good enough to set the attribute on the created package finder.

Changing vendors code needs special care about the patches.

@jfly jfly force-pushed the issue-4885-custom-indices-lacking-hashes branch from 0e4b1ac to 34652df Compare January 7, 2022 06:01
@jfly jfly changed the title RFC: Use a PackageFinder with ignore_compatibility when collecting hashes Use a PackageFinder with ignore_compatibility when collecting hashes Jan 7, 2022
@jfly jfly marked this pull request as ready for review January 7, 2022 06:03
@jfly
Copy link
Contributor Author

jfly commented Jan 7, 2022

@frostming I've updated this PR with a test, and the build still seems to be green! Would love your eyes on this again.

jfly added a commit to jfly/pipenv that referenced this pull request Jan 7, 2022
This documents a workaround for
pypa#4909. It feels a bit weird to me
that developers have to pretend to be CI just to run the test suite,
thoug.

I ran into a lot of trouble trying to get the tests to run when working
on pypa#4908, and that was largely
because the instructions in this CONTRIBUTING.md file seem to have
rotted.

1. The bit about "can be run very simply" is just bogus. It
   unfortunately not that simple right now.

2. `make test` (the docker approach) fails for me with this error:

    make test
    docker-compose up
    [+] Running 1/0
     ⠿ Container pipenv-pipenv-tests-1  Recreated                                                                  0.1s
    Attaching to pipenv-pipenv-tests-1
    pipenv-pipenv-tests-1  | Collecting certifi
    pipenv-pipenv-tests-1  |   Downloading https://files.pythonhosted.org/packages/37/45/946c02767aabb873146011e665728b680884cd8fe70dde973c640e45b775/certifi-2021.10.8-py2.py3-none-any.whl (149kB)
    pipenv-pipenv-tests-1  | Installing collected packages: certifi
    pipenv-pipenv-tests-1  | Successfully installed certifi-2021.10.8
    pipenv-pipenv-tests-1  | Path: /root/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
    pipenv-pipenv-tests-1  | Installing Pipenv...
    pipenv-pipenv-tests-1  | Obtaining file:///pipenv
    pipenv-pipenv-tests-1  |     Complete output from command python setup.py egg_info:
    pipenv-pipenv-tests-1  |     Traceback (most recent call last):
    pipenv-pipenv-tests-1  |       File "<string>", line 1, in <module>
    pipenv-pipenv-tests-1  |       File "/pipenv/setup.py", line 55
    pipenv-pipenv-tests-1  |         print(f"\033[1m{s}\033[0m")
    pipenv-pipenv-tests-1  |                                  ^
    pipenv-pipenv-tests-1  |     SyntaxError: invalid syntax
    pipenv-pipenv-tests-1  |
    pipenv-pipenv-tests-1  |     ----------------------------------------
    pipenv-pipenv-tests-1  | Command "python setup.py egg_info" failed with error code 1 in /pipenv/
    pipenv-pipenv-tests-1 exited with code 1

    The docker image it relies upon
    (https://hub.docker.com/r/kennethreitz/pipenv-tests) hasn't been
    updated in 4 years, so I assume it's just not something people use
    anymore?

3. Relatedly, there was a `Dockerfile` at the root of this repo that
   appears to be unused. Let me know if it's used somewhere I'm not
   realizing, I can add it back!

4. `make tests` (mentioned in RELEASING.md) also didn't work for me. I
   added the `CI=1` workaround from
   pypa#4909 to get it working.

5. https://kennethreitz.org/essays/be-cordial-or-be-on-your-way seems to
   be a broken link now. I found
   https://kennethreitz.org/essays/2013/01/27/be-cordial-or-be-on-your-way
   on Google.

6. `./run-tests.sh` doesn't work for me. It's failing for the same
   reason described by @ncoghlan here:
   pypa/pip#7953 (comment). He
   said something about a `PIPENV_BOOTSTRAP` environment variable, but I
   can't find any information about that.
jfly added a commit to jfly/pipenv that referenced this pull request Jan 7, 2022
This documents a workaround for
pypa#4909. It feels a bit weird to me
that developers have to pretend to be CI just to run the test suite,
thoug.

I ran into a lot of trouble trying to get the tests to run when working
on pypa#4908, and that was largely
because the instructions in this CONTRIBUTING.md file seem to have
rotted.

1. The bit about "can be run very simply" is just bogus. It
   unfortunately not that simple right now.

2. `make test` (the docker approach) fails for me with this error:

    ```bash
    $ make test
    docker-compose up
    [+] Running 1/0
     ⠿ Container pipenv-pipenv-tests-1  Recreated                                                                  0.1s
    Attaching to pipenv-pipenv-tests-1
    pipenv-pipenv-tests-1  | Collecting certifi
    pipenv-pipenv-tests-1  |   Downloading https://files.pythonhosted.org/packages/37/45/946c02767aabb873146011e665728b680884cd8fe70dde973c640e45b775/certifi-2021.10.8-py2.py3-none-any.whl (149kB)
    pipenv-pipenv-tests-1  | Installing collected packages: certifi
    pipenv-pipenv-tests-1  | Successfully installed certifi-2021.10.8
    pipenv-pipenv-tests-1  | Path: /root/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
    pipenv-pipenv-tests-1  | Installing Pipenv...
    pipenv-pipenv-tests-1  | Obtaining file:///pipenv
    pipenv-pipenv-tests-1  |     Complete output from command python setup.py egg_info:
    pipenv-pipenv-tests-1  |     Traceback (most recent call last):
    pipenv-pipenv-tests-1  |       File "<string>", line 1, in <module>
    pipenv-pipenv-tests-1  |       File "/pipenv/setup.py", line 55
    pipenv-pipenv-tests-1  |         print(f"\033[1m{s}\033[0m")
    pipenv-pipenv-tests-1  |                                  ^
    pipenv-pipenv-tests-1  |     SyntaxError: invalid syntax
    pipenv-pipenv-tests-1  |
    pipenv-pipenv-tests-1  |     ----------------------------------------
    pipenv-pipenv-tests-1  | Command "python setup.py egg_info" failed with error code 1 in /pipenv/
    pipenv-pipenv-tests-1 exited with code 1
    ```

    The docker image it relies upon
    (https://hub.docker.com/r/kennethreitz/pipenv-tests) hasn't been
    updated in 4 years, so I assume it's just not something people use
    anymore?

3. Relatedly, there was a `Dockerfile` at the root of this repo that
   appears to be unused. Let me know if it's used somewhere I'm not
   realizing, I can add it back!

4. `make tests` (mentioned in RELEASING.md) also didn't work for me. I
   added the `CI=1` workaround from
   pypa#4909 to get it working.

5. https://kennethreitz.org/essays/be-cordial-or-be-on-your-way seems to
   be a broken link now. I found
   https://kennethreitz.org/essays/2013/01/27/be-cordial-or-be-on-your-way
   on Google.

6. `./run-tests.sh` doesn't work for me. It's failing for the same
   reason described by @ncoghlan here:
   pypa/pip#7953 (comment). He
   said something about a `PIPENV_BOOTSTRAP` environment variable, but I
   can't find any information about that.
jfly added a commit to jfly/pipenv that referenced this pull request Jan 7, 2022
This documents a workaround for
pypa#4909. It feels a bit weird to me
that developers have to pretend to be CI just to run the test suite,
thoug.

I ran into a lot of trouble trying to get the tests to run when working
on pypa#4908, and that was largely
because the instructions in this CONTRIBUTING.md file seem to have
rotted.

1. The bit about "can be run very simply" is just bogus. It
   unfortunately not that simple right now.

2. `make test` (the docker approach) fails for me with this error:

    ```bash
    $ make test
    docker-compose up
    [+] Running 1/0
     ⠿ Container pipenv-pipenv-tests-1  Recreated                                                                  0.1s
    Attaching to pipenv-pipenv-tests-1
    pipenv-pipenv-tests-1  | Collecting certifi
    pipenv-pipenv-tests-1  |   Downloading https://files.pythonhosted.org/packages/37/45/946c02767aabb873146011e665728b680884cd8fe70dde973c640e45b775/certifi-2021.10.8-py2.py3-none-any.whl (149kB)
    pipenv-pipenv-tests-1  | Installing collected packages: certifi
    pipenv-pipenv-tests-1  | Successfully installed certifi-2021.10.8
    pipenv-pipenv-tests-1  | Path: /root/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
    pipenv-pipenv-tests-1  | Installing Pipenv...
    pipenv-pipenv-tests-1  | Obtaining file:///pipenv
    pipenv-pipenv-tests-1  |     Complete output from command python setup.py egg_info:
    pipenv-pipenv-tests-1  |     Traceback (most recent call last):
    pipenv-pipenv-tests-1  |       File "<string>", line 1, in <module>
    pipenv-pipenv-tests-1  |       File "/pipenv/setup.py", line 55
    pipenv-pipenv-tests-1  |         print(f"\033[1m{s}\033[0m")
    pipenv-pipenv-tests-1  |                                  ^
    pipenv-pipenv-tests-1  |     SyntaxError: invalid syntax
    pipenv-pipenv-tests-1  |
    pipenv-pipenv-tests-1  |     ----------------------------------------
    pipenv-pipenv-tests-1  | Command "python setup.py egg_info" failed with error code 1 in /pipenv/
    pipenv-pipenv-tests-1 exited with code 1
    ```

    The docker image it relies upon
    (https://hub.docker.com/r/kennethreitz/pipenv-tests) hasn't been
    updated in 4 years, so I assume it's just not something people use
    anymore?

3. Relatedly, there was a `Dockerfile` at the root of this repo that
   appears to be unused. Let me know if it's used somewhere I'm not
   realizing, I can add it back!

4. `make tests` (mentioned in RELEASING.md) also didn't work for me. I
   added the `CI=1` workaround from
   pypa#4909 to get it working.

5. https://kennethreitz.org/essays/be-cordial-or-be-on-your-way seems to
   be a broken link now. I found
   https://kennethreitz.org/essays/2013/01/27/be-cordial-or-be-on-your-way
   on Google.

6. `./run-tests.sh` doesn't work for me. It's failing for the same
   reason described by @ncoghlan here:
   pypa/pip#7953 (comment). He
   said something about a `PIPENV_BOOTSTRAP` environment variable, but I
   can't find any information about that.
@frostming
Copy link
Contributor

LGTM!

@frostming frostming merged commit c8f34dd into pypa:main Jan 7, 2022
jfly added a commit to jfly/pipenv that referenced this pull request Jan 7, 2022
This documents a workaround for
pypa#4909. It feels a bit weird to me
that developers have to pretend to be CI just to run the test suite,
though.

I ran into a lot of trouble trying to get the tests to run when working
on pypa#4908, and that was largely
because the instructions in this CONTRIBUTING.md file seem to have
rotted.

1. The bit about "can be run very simply" is bogus. It's
   unfortunately not that simple right now.

2. `make test` (the docker approach) fails for me with this error:

    ```bash
    $ make test
    docker-compose up
    [+] Running 1/0
     ⠿ Container pipenv-pipenv-tests-1  Recreated                                                                  0.1s
    Attaching to pipenv-pipenv-tests-1
    pipenv-pipenv-tests-1  | Collecting certifi
    pipenv-pipenv-tests-1  |   Downloading https://files.pythonhosted.org/packages/37/45/946c02767aabb873146011e665728b680884cd8fe70dde973c640e45b775/certifi-2021.10.8-py2.py3-none-any.whl (149kB)
    pipenv-pipenv-tests-1  | Installing collected packages: certifi
    pipenv-pipenv-tests-1  | Successfully installed certifi-2021.10.8
    pipenv-pipenv-tests-1  | Path: /root/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
    pipenv-pipenv-tests-1  | Installing Pipenv...
    pipenv-pipenv-tests-1  | Obtaining file:///pipenv
    pipenv-pipenv-tests-1  |     Complete output from command python setup.py egg_info:
    pipenv-pipenv-tests-1  |     Traceback (most recent call last):
    pipenv-pipenv-tests-1  |       File "<string>", line 1, in <module>
    pipenv-pipenv-tests-1  |       File "/pipenv/setup.py", line 55
    pipenv-pipenv-tests-1  |         print(f"\033[1m{s}\033[0m")
    pipenv-pipenv-tests-1  |                                  ^
    pipenv-pipenv-tests-1  |     SyntaxError: invalid syntax
    pipenv-pipenv-tests-1  |
    pipenv-pipenv-tests-1  |     ----------------------------------------
    pipenv-pipenv-tests-1  | Command "python setup.py egg_info" failed with error code 1 in /pipenv/
    pipenv-pipenv-tests-1 exited with code 1
    ```

    The docker image it relies upon
    (https://hub.docker.com/r/kennethreitz/pipenv-tests) hasn't been
    updated in 4 years, so I assume it's just not something people use
    anymore?

3. Relatedly, there was a `Dockerfile` at the root of this repo that
   appears to be unused. Let me know if it's used somewhere I'm not
   realizing, I can add it back!

4. `make tests` (mentioned in RELEASING.md) also didn't work for me. I
   added the `CI=1` workaround from
   pypa#4909 to get it working.

5. https://kennethreitz.org/essays/be-cordial-or-be-on-your-way seems to
   be a broken link now. I found
   https://kennethreitz.org/essays/2013/01/27/be-cordial-or-be-on-your-way
   on Google.

6. `./run-tests.sh` doesn't work for me. It's failing for the same
   reason described by @ncoghlan here:
   pypa/pip#7953 (comment). He
   said something about a `PIPENV_BOOTSTRAP` environment variable, but I
   can't find any information about that.
@jfly
Copy link
Contributor Author

jfly commented Jan 7, 2022

Thanks for the quick response, @frostming!

@jfly jfly deleted the issue-4885-custom-indices-lacking-hashes branch January 7, 2022 07:14
jfly added a commit to jfly/pipenv that referenced this pull request Jan 7, 2022
This adds and documents a workaround for
pypa#4909. It feels a bit weird to
pretend to be CI just to run the test suite, though. Maybe we can do
something about that later.

I ran into a lot of trouble trying to get the tests to run when working
on pypa#4908, and that was largely
because the instructions in this CONTRIBUTING.md file seem to have
rotted.

1. The bit about "can be run very simply" is bogus. It's
   unfortunately not that simple right now.

2. `make test` (the docker approach) fails for me with this error:

    ```bash
    $ make test
    docker-compose up
    [+] Running 1/0
     ⠿ Container pipenv-pipenv-tests-1  Recreated                                                                  0.1s
    Attaching to pipenv-pipenv-tests-1
    pipenv-pipenv-tests-1  | Collecting certifi
    pipenv-pipenv-tests-1  |   Downloading https://files.pythonhosted.org/packages/37/45/946c02767aabb873146011e665728b680884cd8fe70dde973c640e45b775/certifi-2021.10.8-py2.py3-none-any.whl (149kB)
    pipenv-pipenv-tests-1  | Installing collected packages: certifi
    pipenv-pipenv-tests-1  | Successfully installed certifi-2021.10.8
    pipenv-pipenv-tests-1  | Path: /root/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
    pipenv-pipenv-tests-1  | Installing Pipenv...
    pipenv-pipenv-tests-1  | Obtaining file:///pipenv
    pipenv-pipenv-tests-1  |     Complete output from command python setup.py egg_info:
    pipenv-pipenv-tests-1  |     Traceback (most recent call last):
    pipenv-pipenv-tests-1  |       File "<string>", line 1, in <module>
    pipenv-pipenv-tests-1  |       File "/pipenv/setup.py", line 55
    pipenv-pipenv-tests-1  |         print(f"\033[1m{s}\033[0m")
    pipenv-pipenv-tests-1  |                                  ^
    pipenv-pipenv-tests-1  |     SyntaxError: invalid syntax
    pipenv-pipenv-tests-1  |
    pipenv-pipenv-tests-1  |     ----------------------------------------
    pipenv-pipenv-tests-1  | Command "python setup.py egg_info" failed with error code 1 in /pipenv/
    pipenv-pipenv-tests-1 exited with code 1
    ```

    The docker image it relies upon
    (https://hub.docker.com/r/kennethreitz/pipenv-tests) hasn't been
    updated in 4 years, so I assume it's just not something people use
    anymore?

3. Relatedly, there was a `Dockerfile` at the root of this repo that
   appears to be unused. Let me know if it's used somewhere I'm not
   realizing, I can add it back!

4. https://kennethreitz.org/essays/be-cordial-or-be-on-your-way seems to
   be a broken link now. I found
   https://kennethreitz.org/essays/2013/01/27/be-cordial-or-be-on-your-way
   on Google.

5. `./run-tests.sh` doesn't work for me. It's failing for the same
   reason described by @ncoghlan here:
   pypa/pip#7953 (comment). He
   said something about a `PIPENV_BOOTSTRAP` environment variable, but I
   can't find any information about that.
jfly added a commit to jfly/pipenv that referenced this pull request Jan 7, 2022
This adds and documents a workaround for
pypa#4909. It feels a bit weird to
pretend to be CI just to run the test suite, though. Maybe we can do
something about that later.

I ran into a lot of trouble trying to get the tests to run when working
on pypa#4908, and that was largely
because the instructions in this CONTRIBUTING.md file seem to have
rotted.

1. The bit about "can be run very simply" is bogus. It's
   unfortunately not that simple right now.

2. `make test` (the docker approach) fails for me with this error:

    ```bash
    $ make test
    docker-compose up
    [+] Running 1/0
     ⠿ Container pipenv-pipenv-tests-1  Recreated                                                                  0.1s
    Attaching to pipenv-pipenv-tests-1
    pipenv-pipenv-tests-1  | Collecting certifi
    pipenv-pipenv-tests-1  |   Downloading https://files.pythonhosted.org/packages/37/45/946c02767aabb873146011e665728b680884cd8fe70dde973c640e45b775/certifi-2021.10.8-py2.py3-none-any.whl (149kB)
    pipenv-pipenv-tests-1  | Installing collected packages: certifi
    pipenv-pipenv-tests-1  | Successfully installed certifi-2021.10.8
    pipenv-pipenv-tests-1  | Path: /root/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
    pipenv-pipenv-tests-1  | Installing Pipenv...
    pipenv-pipenv-tests-1  | Obtaining file:///pipenv
    pipenv-pipenv-tests-1  |     Complete output from command python setup.py egg_info:
    pipenv-pipenv-tests-1  |     Traceback (most recent call last):
    pipenv-pipenv-tests-1  |       File "<string>", line 1, in <module>
    pipenv-pipenv-tests-1  |       File "/pipenv/setup.py", line 55
    pipenv-pipenv-tests-1  |         print(f"\033[1m{s}\033[0m")
    pipenv-pipenv-tests-1  |                                  ^
    pipenv-pipenv-tests-1  |     SyntaxError: invalid syntax
    pipenv-pipenv-tests-1  |
    pipenv-pipenv-tests-1  |     ----------------------------------------
    pipenv-pipenv-tests-1  | Command "python setup.py egg_info" failed with error code 1 in /pipenv/
    pipenv-pipenv-tests-1 exited with code 1
    ```

    The docker image it relies upon
    (https://hub.docker.com/r/kennethreitz/pipenv-tests) hasn't been
    updated in 4 years, so I assume it's just not something people use
    anymore?

3. Relatedly, there was a `Dockerfile` at the root of this repo that
   appears to be unused. Let me know if it's used somewhere I'm not
   realizing, I can add it back!

4. https://kennethreitz.org/essays/be-cordial-or-be-on-your-way seems to
   be a broken link now. I found
   https://kennethreitz.org/essays/2013/01/27/be-cordial-or-be-on-your-way
   on Google.

5. `./run-tests.sh` doesn't work for me. It's failing for the same
   reason described by @ncoghlan here:
   pypa/pip#7953 (comment). He
   said something about a `PIPENV_BOOTSTRAP` environment variable, but I
   can't find any information about that.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Problem with lacking hashes for pipenv with custom index url
2 participants